﻿<?php
include("./include/common.php");
if ($config['rank'] == '开放') {
    $top5 = rank(5);
}
?>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=5">
    <title><?php echo $config['sitename']; ?></title>
    <meta name="description" content="<?php echo $config['description']; ?>">
    <meta name="keywords" content="<?php echo $config['keywords']; ?>">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="icon" type="image/x-icon" href="/favicon.ico">
    <link rel="stylesheet" href="/assets/css/index.css">
    <link href="/component/layui/css/layui.css" rel="stylesheet">
    <link href="/component/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<!-- require APlayer -->
	<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
	<script src="//cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
	<!-- require MetingJS -->
	<script src="//cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js"></script>
    <script type="text/javascript">
        if (!!window.ActiveXObject || "ActiveXObject" in window) { //is IE?
            alert('朋友，上古浏览器不支持呢~');
        }
    </script>
</head>

<body>
    <div id="body-wrap">
        <div class="layui-carousel" style="width: 100%; height: 20rem; position: relative; background-color: #49b1f5;">
            <div carousel-item>
                <div style="background-image:url(/assets/images/bg1.jpg)"></div>
                <div style="background-image:url(/assets/images/bg2.jpg)"></div>
                <div style="background-image:url(/assets/images/bg3.jpg)"></div>
                <div style="background-image:url(/assets/images/bg4.jpg)"></div>
                <div style="background-image:url(/assets/images/2022.jpg)"></div>
                <div style="background-image:url(/assets/images/tiangong.jpg)"></div>
                <div style="background-image:url(/assets/images/weixing.jpg)"></div>
            </div>
        </div>
        <div id="page_site-info" style="z-index:99;">
            <div id="site-title">
                <span class="blogtitle"></span>
            </div>
        </div>
        <main id="content-outer">
            <div class="layout_page" id="content-inner">
                <div class="aside_content" id="aside_content">
                    <div class="card-widget card-info">
                        <div class="card-content">
                            <div class="card-info-avatar is-center">
                                <img class="avatar-img" src="/assets/images/logo.png" alt="avatar">
                                <div class="author-info__name"><?php echo $config['sitename']; ?></div>
                                <div class="author-info__description">欢迎来到泽宇写的答题系统！</div>
                            </div>
                            <div class="card-info-social-icons is-center">
                                <svg t="1644413571915" class="social-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2470" width="30" height="30">
                                    <path d="M221.76 914.218667a150.229333 69.781333 0 1 0 300.458667 0 150.229333 69.781333 0 1 0-300.458667 0Z" fill="#FFBD14" p-id="2471"></path>
                                    <path d="M376.448 971.562667c-82.965333 0-150.229333-31.232-150.229333-69.781334 0-1.728 0.298667-3.434667 0.554666-5.141333a35.84 35.84 0 0 0-5.013333 17.6c0 38.528 67.264 69.781333 150.229333 69.781333 79.232 0 143.978667-28.501333 149.653334-64.64-16.789333 29.994667-75.328 52.181333-145.194667 52.181334z" fill="#EF9E0D" p-id="2472"></path>
                                    <path d="M539.989333 914.218667a150.229333 69.781333 0 1 0 300.458667 0 150.229333 69.781333 0 1 0-300.458667 0Z" fill="#FFBD14" p-id="2473"></path>
                                    <path d="M685.781333 971.562667c82.965333 0 150.229333-31.232 150.229334-69.781334 0-1.728-0.298667-3.434667-0.554667-5.141333 3.157333 5.632 5.013333 11.498667 5.013333 17.6 0 38.528-67.264 69.781333-150.229333 69.781333-79.232 0-143.978667-28.501333-149.653333-64.64 16.768 29.994667 75.328 52.181333 145.194666 52.181334z" fill="#EF9E0D" p-id="2474"></path>
                                    <path d="M865.28 512l-33.770667-108.437333c0-353.045333-285.44-354.218667-300.202666-354.218667-15.338667 0-300.181333 1.173333-300.181334 354.218667L197.333333 512s-114.666667 144-37.333333 269.333333c8.661333 5.994667 9.344 28.010667 56-70.677333 0 0 62.634667 220.693333 313.728 222.570667v0.085333l1.578667-0.042667 1.578666 0.042667v-0.085333c251.072-1.877333 313.728-222.570667 313.728-222.570667 46.677333 98.666667 47.616 78.677333 56 70.677333 77.333333-125.333333-37.333333-269.333333-37.333333-269.333333z" fill="#121214" p-id="2475"></path>
                                    <path d="M544.448 281.770667a85.333333 60.672 90 1 0 121.344 0 85.333333 60.672 90 1 0-121.344 0Z" fill="#FFFFFF" p-id="2476"></path>
                                    <path d="M388.48 281.770667a85.333333 60.672 90 1 0 121.344 0 85.333333 60.672 90 1 0-121.344 0Z" fill="#FFFFFF" p-id="2477"></path>
                                    <path d="M437.781333 281.770667a43.456 30.890667 90 1 0 61.781334 0 43.456 30.890667 90 1 0-61.781334 0Z" fill="#161616" p-id="2478"></path>
                                    <path d="M567.488 308.608a6.4 6.4 0 0 1-6.378667-5.738667c-0.405333-3.818667-3.477333-37.76 11.008-53.824 9.834667-10.922667 28.032-10.922667 37.866667 0 14.485333 16.064 11.370667 50.005333 10.986667 53.824a6.186667 6.186667 0 0 1-7.04 5.696 6.421333 6.421333 0 0 1-5.717334-7.04c0.917333-8.810667 1.322667-33.877333-7.744-43.925333a12.650667 12.650667 0 0 0-18.837333 0c-9.109333 10.090667-8.704 35.136-7.765333 43.925333a6.4 6.4 0 0 1-5.717334 7.04c-0.234667 0.042667-0.469333 0.042667-0.661333 0.042667z" fill="#181818" p-id="2479"></path>
                                    <path d="M468.650667 269.717333a13.312 9.472 90 1 0 18.944 0 13.312 9.472 90 1 0-18.944 0Z" fill="#FFFFFF" p-id="2480"></path>
                                    <path d="M693.333333 407.104c-49.344-23.104-128.448-30.677333-160.448-30.677333s-111.104 7.552-160.448 30.677333c-23.552 8-32.896 14.229333-32.896 21.781333 0 7.552 59.562667 52.010667 123.114667 79.104 29.866667 15.104 38.677333 28.010667 70.229333 28.010667s40.341333-12.885333 70.229334-28.010667c63.552-27.114667 123.114667-71.552 123.114666-79.104 0-7.552-9.344-13.781333-32.896-21.781333z" fill="#FAB718" p-id="2481"></path>
                                    <path d="M376.448 431.104s65.770667 46.229333 152.448 46.229333 157.333333-46.229333 157.333333-46.229333-52.437333 34.666667-92.885333 58.666667-45.781333 30.677333-66.218667 30.677333c-20.437333 0-46.677333-24.896-58.453333-30.677333-11.776-5.76-44.224-29.76-92.224-58.666667z" fill="#8C2B01" p-id="2482"></path>
                                    <path d="M777.322667 475.776c-103.146667 85.994667-245.994667 76.224-245.994667 76.224s-142.848 9.770667-245.994667-76.224c0 0-98.218667 442.453333 245.994667 442.453333s245.994667-442.453333 245.994667-442.453333z" fill="#F9F9F9" p-id="2483"></path>
                                    <path d="M831.552 403.562667s-82.218667 147.562667-300.224 147.562666-300.224-147.562667-300.224-147.562666c-34.666667 95.104-33.770667 108.437333-33.770667 108.437333a416.170667 416.170667 0 0 0 118.442667 91.306667c-2.901333 31.701333-6.869333 80.490667-6.442667 105.365333 0.661333 38.677333 24.277333 41.344 79.146667 46.677333 54.848 5.333333 43.52-9.344 43.52-34.005333v-77.888c58.176 11.2 99.328 7.232 99.328 7.232s190.890667 19.562667 333.994667-138.666667c0-0.021333 0.896-13.354667-33.770667-108.458666z" fill="#E32B10" p-id="2484"></path>
                                </svg>
                                <a href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $config['kfqq']; ?>&site=qq&menu=yes" target="_blank" style="font-size: 1.1rem;">在线客服</a>
                            </div>
                        </div>
                    </div>

                    <div class="card-widget card-webinfo">
                        <div class="card-content">
                            <div class="item-headline">
                                <i class="fa fa-line-chart" aria-hidden="true"></i>
                                <span>站点信息</span>
                            </div>
                            <div class="webinfo">
                                <div class="webinfo-item">
                                    <div class="webinfo-site-uv-name">本站用户数 :</div>
                                    <div class="webinfo-site-uv-count"><?php echo end($DB->get_row("SELECT count(*) FROM `user`")); ?></div>
                                </div>
                                <div class="webinfo-item">
                                    <div class="webinfo-site-name">本站总答题数 :</div>
                                    <div class="webinfo-site-pv-count"><?php echo end($DB->get_row("SELECT count(*) FROM `answer`")); ?></div>
                                </div>
                                <div class="webinfo-item">
                                    <div class="webinfo-site-name">本页面总查询数 :</div>
                                    <div class="webinfo-site-pv-count"><?php echo $DB->queries; ?></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php if ($config['rank'] == '开放') {
                    ?>

                        <div class="card-widget card-webinfo">
                            <div class="card-content">
                                <div class="item-headline">
                                    <i class="fa fa-line-chart" aria-hidden="true"></i>
                                    <span>排行榜</span>
                                </div>
                                <div class="webinfo">
                                    <div class="webinfo-item">
                                        <div class="webinfo-site-uv-name"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1512" width="25" height="25">
                                                <path d="M797.4 331.7H226.6v-315c0-9.2 7.5-16.7 16.7-16.7h537.4c9.2 0 16.7 7.5 16.7 16.7v315z" fill="#FFF7D7" p-id="1513"></path>
                                                <path d="M226.6 0h136.6v300.2H226.6V0z m217.1 0h136.6v300.2H443.7V0z m217.1 0h136.6v300.2H660.8V0z" fill="#F94F46" p-id="1514"></path>
                                                <path d="M97.4 599.2c0 228.6 185.3 414 414 414s414-185.3 414-414-185.3-414-414-414-414 185.4-414 414z" fill="#FEE701" p-id="1515"></path>
                                                <path d="M203.5 599.2c0 110 58.7 211.7 154 266.7s212.6 55 307.9 0c95.3-55 154-156.7 154-266.7 0-170.1-137.9-307.9-307.9-307.9s-308 137.8-308 307.9z" fill="#F5B319" p-id="1516"></path>
                                                <path d="M620.2 769H406.6v-20.2c52.4 1.4 75.2-14.1 68.5-46.4V490.8c6.7-21.5-12.1-30.9-56.4-28.2v-22.2c47 0 81.3-10.1 102.8-30.2h32.2v292.3c-6.7 32.2 15.4 47.7 66.5 46.4V769z" fill="#FEE701" p-id="1517"></path>
                                                <path d="M267.4 351.4c-4.5 0-8.9-1.8-12.3-5.3-6.4-6.8-6.1-17.5 0.7-23.9 6.6-6.2 13.5-12.2 20.5-17.9 3.4-2.7 6.8-5.4 10.2-8 7.5-5.7 18.1-4.2 23.6 3.3 5.7 7.5 4.2 18.1-3.3 23.6-3.2 2.4-6.2 4.7-9.3 7.2-6.3 5.2-12.7 10.6-18.7 16.3-3.1 3.3-7.3 4.7-11.4 4.7z m608 215.2c-8.3 0-15.5-6.1-16.7-14.6-3.5-25.4-9.8-50.4-18.9-74.5-30.4-81.2-89.8-147.6-167-186.9-47.8-24.3-99.2-37-152.4-37.7-51.9-0.7-104.1 10.7-151.3 32.8-6.7 3.2-13.3 6.6-19.9 10.1-8.1 4.5-18.4 1.5-23-6.7-4.5-8.1-1.5-18.4 6.7-23 7.1-4 14.5-7.7 21.8-11.1 51.7-24.2 108.9-36.6 166-36 58.5 0.7 114.8 14.6 167.4 41.3 85 43.3 150.2 116.1 183.5 205.2 9.8 26.3 16.8 53.8 20.7 81.6 1.2 9.3-5.2 17.8-14.5 19-0.8 0.4-1.6 0.5-2.4 0.5z" fill="#FFFFFF" p-id="1518"></path>
                                            </svg>
                                            <?php echo $top5[1]['name']; ?></div>
                                        <div class="webinfo-site-uv-count"><?php echo round($top5[1]['score']); ?></div>
                                    </div>
                                    <div class="webinfo-item">
                                        <div class="webinfo-site-name"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1512" width="25" height="25">
                                                <path d="M797.4 331.7H226.6v-315c0-9.2 7.5-16.7 16.7-16.7h537.4c9.2 0 16.7 7.5 16.7 16.7v315z" fill="#FFF7D7" p-id="1513"></path>
                                                <path d="M226.6 0h136.6v300.2H226.6V0z m217.1 0h136.6v300.2H443.7V0z m217.1 0h136.6v300.2H660.8V0z" fill="#0072D9" p-id="1514"></path>
                                                <path d="M97.4 599.2c0 228.6 185.3 414 414 414s414-185.3 414-414-185.3-414-414-414-414 185.4-414 414z" fill="#EEEEEE" p-id="1515"></path>
                                                <path d="M203.5 599.2c0 110 58.7 211.7 154 266.7s212.6 55 307.9 0c95.3-55 154-156.7 154-266.7 0-170.1-137.9-307.9-307.9-307.9s-308 137.8-308 307.9z" fill="#DDDDDD" p-id="1516"></path>
                                                <path d="M620.2 769H406.6v-20.2c52.4 1.4 75.2-14.1 68.5-46.4V490.8c6.7-21.5-12.1-30.9-56.4-28.2v-22.2c47 0 81.3-10.1 102.8-30.2h32.2v292.3c-6.7 32.2 15.4 47.7 66.5 46.4V769z" fill="#999999" p-id="1517"></path>
                                                <path d="M267.4 351.4c-4.5 0-8.9-1.8-12.3-5.3-6.4-6.8-6.1-17.5 0.7-23.9 6.6-6.2 13.5-12.2 20.5-17.9 3.4-2.7 6.8-5.4 10.2-8 7.5-5.7 18.1-4.2 23.6 3.3 5.7 7.5 4.2 18.1-3.3 23.6-3.2 2.4-6.2 4.7-9.3 7.2-6.3 5.2-12.7 10.6-18.7 16.3-3.1 3.3-7.3 4.7-11.4 4.7z m608 215.2c-8.3 0-15.5-6.1-16.7-14.6-3.5-25.4-9.8-50.4-18.9-74.5-30.4-81.2-89.8-147.6-167-186.9-47.8-24.3-99.2-37-152.4-37.7-51.9-0.7-104.1 10.7-151.3 32.8-6.7 3.2-13.3 6.6-19.9 10.1-8.1 4.5-18.4 1.5-23-6.7-4.5-8.1-1.5-18.4 6.7-23 7.1-4 14.5-7.7 21.8-11.1 51.7-24.2 108.9-36.6 166-36 58.5 0.7 114.8 14.6 167.4 41.3 85 43.3 150.2 116.1 183.5 205.2 9.8 26.3 16.8 53.8 20.7 81.6 1.2 9.3-5.2 17.8-14.5 19-0.8 0.4-1.6 0.5-2.4 0.5z" fill="#FFFFFF" p-id="1518"></path>
                                            </svg>
                                            <?php echo $top5[2]['name']; ?></div>
                                        <div class="webinfo-site-pv-count"><?php echo round($top5[2]['score']); ?></div>
                                    </div>
                                    <div class="webinfo-item">
                                        <div class="webinfo-site-name">
                                            <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1512" width="25" height="25">
                                                <path d="M797.4 331.7H226.6v-315c0-9.2 7.5-16.7 16.7-16.7h537.4c9.2 0 16.7 7.5 16.7 16.7v315z" fill="#FFF7D7" p-id="1513"></path>
                                                <path d="M226.6 0h136.6v300.2H226.6V0z m217.1 0h136.6v300.2H443.7V0z m217.1 0h136.6v300.2H660.8V0z" fill="#35BBEE" p-id="1514"></path>
                                                <path d="M97.4 599.2c0 228.6 185.3 414 414 414s414-185.3 414-414-185.3-414-414-414-414 185.4-414 414z" fill="#FCC376" p-id="1515"></path>
                                                <path d="M203.5 599.2c0 110 58.7 211.7 154 266.7s212.6 55 307.9 0c95.3-55 154-156.7 154-266.7 0-170.1-137.9-307.9-307.9-307.9s-308 137.8-308 307.9z" fill="#E19547" p-id="1516"></path>
                                                <path d="M620.2 769H406.6v-20.2c52.4 1.4 75.2-14.1 68.5-46.4V490.8c6.7-21.5-12.1-30.9-56.4-28.2v-22.2c47 0 81.3-10.1 102.8-30.2h32.2v292.3c-6.7 32.2 15.4 47.7 66.5 46.4V769z" fill="#FEE701" p-id="1517"></path>
                                                <path d="M267.4 351.4c-4.5 0-8.9-1.8-12.3-5.3-6.4-6.8-6.1-17.5 0.7-23.9 6.6-6.2 13.5-12.2 20.5-17.9 3.4-2.7 6.8-5.4 10.2-8 7.5-5.7 18.1-4.2 23.6 3.3 5.7 7.5 4.2 18.1-3.3 23.6-3.2 2.4-6.2 4.7-9.3 7.2-6.3 5.2-12.7 10.6-18.7 16.3-3.1 3.3-7.3 4.7-11.4 4.7z m608 215.2c-8.3 0-15.5-6.1-16.7-14.6-3.5-25.4-9.8-50.4-18.9-74.5-30.4-81.2-89.8-147.6-167-186.9-47.8-24.3-99.2-37-152.4-37.7-51.9-0.7-104.1 10.7-151.3 32.8-6.7 3.2-13.3 6.6-19.9 10.1-8.1 4.5-18.4 1.5-23-6.7-4.5-8.1-1.5-18.4 6.7-23 7.1-4 14.5-7.7 21.8-11.1 51.7-24.2 108.9-36.6 166-36 58.5 0.7 114.8 14.6 167.4 41.3 85 43.3 150.2 116.1 183.5 205.2 9.8 26.3 16.8 53.8 20.7 81.6 1.2 9.3-5.2 17.8-14.5 19-0.8 0.4-1.6 0.5-2.4 0.5z" fill="#FFFFFF" p-id="1518"></path>
                                            </svg>
                                            <?php echo $top5[3]['name']; ?>
                                        </div>
                                        <div class="webinfo-site-pv-count"><?php echo round($top5[3]['score']); ?></div>
                                    </div>
                                    <div class="webinfo-item">
                                        <div class="webinfo-site-name">
                                            <b>No.4</b> <?php echo $top5[4]['name']; ?>
                                        </div>
                                        <div class="webinfo-site-pv-count"><?php echo round($top5[4]['score']); ?></div>
                                    </div>
                                    <div class="webinfo-item">
                                        <div class="webinfo-site-name">
                                            <b>No.5</b> <?php echo $top5[5]['name']; ?>
                                        </div>
                                        <div class="webinfo-site-pv-count"><?php echo round($top5[5]['score']); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php
                    } ?>
                </div>
                <article id="page">
                    <div class="article-container">
                        <h2>一起向未来</h2>
                        <meting-js server="netease" type="playlist" id="5448504071" theme="#2d8cf0"></meting-js>
                        <hr>
                        <h2><a href="/user" target="_blank">用户端 点我跳转</a></h2>
                        <div class="tool">
                            <img src="/assets/images/user1.png" data-action="zoom"><br>
                            <img src="/assets/images/user2.png" data-action="zoom"><br>
                        </div>

                        <hr>
                        <h2><a href="/admin" target="_blank">管理端 点我跳转</a></h2>
                        <div class="tool">
                            <img src="/assets/images/admin1.png" data-action="zoom"><br>
                            <img src="/assets/images/admin2.png" data-action="zoom"><br>
                        </div>
                    </div>
                </article>
            </div>
        </main>
        <footer id="footer">
            <div id="footer-wrap">
                <div class="copyright">&copy;2021 - 2022 BY 泽宇大大</div>
            </div>
        </footer>
    </div>
    <!-- aplayer、meting -->

    <!-- 依 赖 脚 本 -->
    <script src="/component/layui/layui.js"></script>
    <!-- 打字机效果 -->
    <script src="//cdn.jsdelivr.net/npm/typed.js@2.0.11"></script>
    <!-- 图片放大 -->
    <script src="//cdn.jsdelivr.net/npm/@nishanths/zoom.js@3.1.0/dist/zoom.min.js"></script>

    <script type="text/javascript">
        //console.clear();

        layui.use(['jquery', 'carousel', ], function() {
            var $ = layui.jquery,
                carousel = layui.carousel;

            (function($) {
                $.fn.snow = function(options) {
                    var $flake = $('<div id="snowbox" />').css({ 'position': 'absolute', 'z-index': '9999', 'top': '-50px' }).html('&#10052;'), documentHeight = $(document).height(), documentWidth = $(document).width(), defaults = { minSize: 10, maxSize: 20, newOn: 1000, flakeColor: "#AACCEF" /* 此处可以定义雪花颜色，若要白色可以改为#FFFFFF */ }, options = $.extend({}, defaults, options); var interval = setInterval(function() { var startPositionLeft = Math.random() * documentWidth - 100, startOpacity = 0.5 + Math.random(), sizeFlake = options.minSize + Math.random() * options.maxSize, endPositionTop = documentHeight - 200, endPositionLeft = startPositionLeft - 500 + Math.random() * 500, durationFall = documentHeight * 10 + Math.random() * 5000; $flake.clone().appendTo('body').css({ left: startPositionLeft, opacity: startOpacity, 'font-size': sizeFlake, color: options.flakeColor }).animate({ top: endPositionTop, left: endPositionLeft, opacity: 0.2 }, durationFall, 'linear', function() { $(this).remove() }); }, options.newOn);
                };
            })($);
            $(function() {
                $.fn.snow({
                    minSize: 10,
                    /* 定义雪花最小尺寸 */
                    maxSize: 50,
                    /* 定义雪花最大尺寸 */
                    newOn: 800 /* 定义密集程度，数字越小越密集 */
                });
            });

            // 打字机效果
            var typed = new Typed(".blogtitle", {
                strings: ['欢迎来到<?php echo $config["sitename"]; ?>',
                    '一起向未来', 'Together for a Shared Future.',
                    '热情连接世界', 'Connecting The World By Enthusiasm.'
                ],
                startDelay: 300,
                typeSpeed: 100,
                loop: true,
                backSpeed: 50,
                showCursor: true
            });

            //轮播图
            carousel.render({
                elem: '.layui-carousel',
                width: '100%',
                height: '20rem',
                arrow: 'always' //始终显示箭头
            });
        });
    </script>
</body>

</html>